import type { FormOptions } from '@/components/ui/form/src/types/type'

export const passwordFormOptions: FormOptions[] = [
  {
    type: 'input-password',
    value: '',
    label: 'Current Password',
    required: 'currentPassword',
    prop: 'currentPassword',
    attrs: {
      allowClear: true,
    },
    rules: [
      {
        required: true,
        message: 'Please enter the currentPassword',
        trigger: 'blur',
      },
      {
        min: 6,
        max: 50,
        message: 'The length is between 6 and 50 characters',
        trigger: 'blur',
      },
    ],
  },
  {
    type: 'input-password',
    value: '',
    label: 'New Password',
    required: 'newPassword',
    prop: 'newPassword',
    attrs: {
      allowClear: true,
    },
    rules: [
      {
        required: true,
        message: 'Please enter the newPassword',
        trigger: 'blur',
      },
      {
        min: 6,
        max: 50,
        message: 'The length is between 6 and 50 characters',
        trigger: 'blur',
      },
    ],
  },
  {
    type: 'input-password',
    value: '',
    label: 'Check Password',
    required: 'checkPassword',
    prop: 'checkPassword',
    attrs: {
      allowClear: true,
    },
    rules: [
      {
        required: true,
        trigger: 'blur',
      },
    ],
  },
]

export const historyColumns = [
  { title: 'User Name', dataIndex: 'username' },
  // { title: 'User Role', dataIndex: 'userRole' },
  { title: 'Login Time', dataIndex: 'createTime' },
  { title: 'Host', dataIndex: 'host' },
  { title: 'IP', dataIndex: 'ip' },
  // { title: 'Device', dataIndex: 'device' },
  // { title: 'UA', dataIndex: 'ua', width: 150 },
]
